package 行为型模式.中介者模式;

public class Client {
    public static void main(String[] args) {
        //创建中介者对象
        MediatorStructure mediator=new MediatorStructure();

        //创建两个同事类对象
        //创建租房者对象
        Tenant tenant=new Tenant("李四",mediator);
        //创建房主对象
        HouseOwner houseOwner=new HouseOwner("张三",mediator);

        //中介者要知道具体的房主和租房者
        mediator.setTenant(tenant);
        mediator.setHouseOwner(houseOwner);

        tenant.connect("我要租三居室的房屋");
        houseOwner.connect("我这里有三居室的房子你要租吗");
    }
}
